import request from '@/network/request'

export function fetchAlarmHis(query) {
    return request({
        url: '/alarm/getAlarmHis',
        method: 'get',
        params: query
    })
}
export function fetchList(query) {
    return request({
        url: '/alarm/getAlarmHis',
        method: 'get',
        params: query
    })
}

export function fetchAlarmByID(id) {
    return request({
        url: '/alarm/',
        method: 'get',
        params: { id }
    })
}

export function fetchPv(pv) {
    return request({
        url: '/vue-element-admin/article/pv',
        method: 'get',
        params: { pv }
    })
}

export function createAlarm(data) {
    return request({
        url: '/alarm/newRecord',
        method: 'post',
        data
    })
}

export function updateAlarm(data) {
    return request({
        url: '/alarm/updateRecord',
        method: 'post',
        data
    })
}

export function removeRecord(id) {
    return request({
        url: 'alarm/removeRecord?alarmid=' + id,
        method: 'get',
    })
}